<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>

    </style>
</head>

<body>

    <div id="box">


    </div>


    <script src="./js/react.js"></script>
    <script src="./js/react-dom.js"></script>
    <script src="./js/prop-types.js"></script>
    <script src="./js/babel.min.js"></script>

    <script type="text/babel">

        // 定义一个类组件
        class Book extends React.Component{
       

            render(){
                console.log("this.props.children",this.props.children);
                return (
                    <div>
                        <h1>书籍组件</h1>
                        {this.props.children}
                    </div>
                )
            }

        }

        

        const root = (<div>
            <h1>组件：</h1>
            <Book>
                <p>我是书中的p</p>
            </Book>
        </div>
        );

        ReactDOM.render(root, document.getElementById("box"));


    </script>
</body>

</html>